package view

import (
	"vrcm/src/vrcm/common/models"
)

type ViewLimit struct {
	models.Model

	TenantId      string `json:"tenant_id" gorm:"type:varchar(35);comment:租户"`
	BindId        string `json:"bind_id" gorm:"type:varchar(50);comment:BindId"`
	ViewPage      int    `json:"view_page" gorm:"type:tinyint;comment:1 未启用 2 启用"`
	ViewCondition int    `json:"view_condition" gorm:"type:tinyint;comment:观看条件 1 密码观看 2 公开访问 3 手机白名单"`
	Format        int    `json:"format" gorm:"type:tinyint;comment:格式 1 mp4"`
	Barrage       int    `json:"barrage" gorm:"type:tinyint;comment:1 开启 2 开启"`
	IsDelete      int    `json:"is_delete" gorm:"type:tinyint;comment:1 删除"`
	WeChatType    int    `json:"wechat_type" gorm:"type:tinyint;comment:微信类型 1企业 2普通"`
	GroupId       string `json:"group_id" gorm:"type:varchar(50);comment:聊天室id"`
	Welcome       string `json:"welcome" gorm:"type:varchar(50);comment:欢迎语"`
	models.ModelTime
	models.ControlBy
}

type ViewLimitWithCheck struct {
	ViewLimit  ViewLimit   `json:"view_limit"`
	ViewCheck  []ViewCheck `json:"view_check"`
	WhiteUsers []WhiteUser `json:"whiteUsers"`
}

func (ViewLimit) TableName() string {
	return "view_limit"
}

func (e *ViewLimit) Generate() models.ActiveRecord {
	o := *e
	return &o
}

func (e *ViewLimit) GetId() interface{} {
	return e.Id
}
